HTMLify
admin login.html
Views: 577 | Author: sachinthakur
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Admin Login</title> </head> <body> <header> <div class="container"> <div class="logo"><img src="https://png.pngtree.com/png-vector/20230316/ourmid/pngtree-admin-and-customer-service-job-vacancies-vector-png-image_6650726.png" height="50px" width="100px"></div> <div class="hamburger-menu" onclick="toggleNav()"> ☰ </div> <nav id="mainNav"> <ul> <li><a href="#">Home</a></li> <li><a href="#">About</a></li> <li><a href="#">Contact</a></li> </ul> </nav> </div> </header> <div class="intro"> Welcome to the Admin Login Page. Please login to proceed. </div> <main> <h2>Login</h2> <form id="loginForm"> <input type="text" name="username" placeholder="Username"> <input type="password" name="password" placeholder="Password"> <input type="submit" value="Login"> </form> </main> </body> </html> <style> body { font-family: Arial, sans-serif; margin: 0; padding: 0; background-image: url('https://e1.pxfuel.com/desktop-wallpaper/581/154/desktop-wallpaper-backgrounds-for-login-page-login-page.jpg'); background-size: cover; background-position: center; background-repeat: no-repeat; color: #fff; } header { background-color: rgba(0, 0, 0, 0.7); padding: 10px 0; text-align: center; } .container { display: flex; justify-content: space-between; align-items: center; padding: 0 20px; } .logo { font-size: 24px; } .hamburger-menu { display: none; cursor: pointer; } nav { background-color: rgba(0, 0, 0, 0.7); padding: 10px 0; text-align: center; } nav ul { list-style-type: none; padding: 0; margin: 0; } nav ul li { display: inline-block; } nav ul li a { color: #fff; text-decoration: none; margin: 0 20px; } main { padding: 20px; text-align: center; } form { margin: 0 auto; width: 300px; background-color: rgba(255, 255, 255, 0.7); padding: 20px; border-radius: 10px; } input[type="text"], input[type="password"], input[type="submit"] { display: block; margin: 10px auto; padding: 10px; width: calc(100% - 20px); } .intro { text-align: center; margin-top: 50px; font-size: 18px; } @media (max-width: 768px) { .container { flex-direction: column; } .hamburger-menu { display: block; } nav { display: none; } nav.active { display: block; } nav ul { flex-direction: column; padding: 20px; background-color: rgba(0, 0, 0, 0.7); } nav ul li { display: block; margin-bottom: 10px; } } </style> <script> function toggleNav() { var nav = document.getElementById('mainNav'); nav.classList.toggle('active'); } document.getElementById("loginForm").addEventListener("submit", function(event) { event.preventDefault(); var username = document.getElementsByName("username")[0].value; var password = document.getElementsByName("password")[0].value; if (username.trim() === "" || password.trim() === "") { alert("Please enter both username and password"); } else { alert("Login successful!"); } }); </script> |